var colors = require('colors');
colors.setTheme({
    silly: 'rainbow',
    input: 'grey',
    verbose: 'cyan',
    prompt: 'red',
    info: 'green',
    data: 'blue',
    help: 'cyan',
    warn: 'yellow',
    debug: 'magenta',
    error: 'red'
});
console.log("服务初始化".prompt);
var express = require('express');
var app = express();
var proxy = require('http-proxy-middleware');
var path = require('path')
function resolve(dir) {
    return path.join(__dirname, '..', dir)
}
var port = 3000;
console.log(resolve('/'));
app.use(express.static(resolve('/')));
app.use('/api', proxy({target: 'http://localhost:9000', changeOrigin: true}));
app.listen(port);
console.log(("服务已启动,端口号:" + port).green);
